//
//  FourLines.m
//  Persistence
//
//  Created by KaiKai on 11-8-20.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import "FourLines.h"

@implementation FourLines

@synthesize field1;
@synthesize field2;
@synthesize field3;
@synthesize field4;

- (id)init
{
    self = [super init];
    if (self) {
        // Initialization code here.
    }
    
    return self;
}

- (void)encodeWithCoder:(NSCoder *)aCoder
{
	[aCoder encodeObject:field1 forKey:KField1Key];
	[aCoder encodeObject:field2 forKey:KField2Key];
	[aCoder encodeObject:field3 forKey:KField3Key];
	[aCoder encodeObject:field4 forKey:KField4Key];
}

- (id)initWithCoder:(NSCoder *)aDecoder
{
	if (self = [super init])
	{
		self.field1 = [aDecoder decodeObjectForKey:KField1Key];
		self.field2 = [aDecoder decodeObjectForKey:KField2Key];
		self.field3 = [aDecoder decodeObjectForKey:KField3Key];
		self.field4 = [aDecoder decodeObjectForKey:KField4Key];
	}
	return self;
}

- (id)copyWithZone:(NSZone *)zone
{
	FourLines *copy = [[[self class] allocWithZone:zone] init];
	copy.field1 = [[self.field1 copyWithZone:zone] autorelease];
	copy.field2 = [[self.field2 copyWithZone:zone] autorelease];
	copy.field3 = [[self.field3 copyWithZone:zone] autorelease];
	copy.field4 = [[self.field4 copyWithZone:zone] autorelease];
	
	return copy;
}


@end
